{{extend ("./layout.html")}}

{{#block('body')}}

<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>

<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.js"> </script>

<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"> </script>

<div class="panel panel-default">
    <div class="panel-heading">
          <ol class="breadcrumb">
            <li><a href="#">首页</a></li>
            <li><a href="#">视频管理</a></li>
            <li><a href="#">视频新增</a></li>
          </ol>
    </div>
        <div class="panel-body">   
            <form action="/video/edit/{{video.vid}}" method="post" class="form-horizontal">
              <div class="form-group">
                <label for="vtitle" class="col-sm-2 control-label">视频标题</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" name="vtitle" id="vtitle" value="{{video.vtitle}}" placeholder="视频标题">
                </div>
              </div>
              <div class="form-group">
                <label for="vsortno" class="col-sm-2 control-label">排序号</label>
                <div class="col-sm-10">
                  <input type="Number" class="form-control" name="vsortno" id="vsortno" value="{{video.vsortno}}" placeholder="排序号">
                </div>
              </div>
              <div class="form-group">
                <label for="vvideoid" class="col-sm-2 control-label">视频id</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" name="vvideoid" id="vvideoid" value="{{video.vvideoid}}" placeholder="视频id">
                </div>
              </div>
              <div class="form-group">
                <label for="vsummary" class="col-sm-2 control-label">视频摘要</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" name="vsummary" id="vsummary" value="{{video.vsummary}}"  placeholder="视频摘要">
                </div>
              </div>
              <div class="form-group">
                <label for="vimg" class="col-sm-2 control-label">视频图片</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" name="vimgurl" id="vimgurl" value="{{video.vimgurl}}"  placeholder="视频图片">
                </div>
              </div>
               <div class="form-group">
                <label for="vremark" class="col-sm-2 control-label">视频详情</label>
                <div class="col-sm-10">
                    <script id="editor" name="vremark" type="text/plain" style="width:550px;height:500px;"></script>
                </div>
              </div>
              
              <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                  <button type="submit" class="btn btn-default">保存</button>
                </div>
              </div>
            </form>
    </div> 
</div>

<script type="text/javascript">
    var vremark = "{{video.vremark}}";
    
    //以后应用场景:当我们发现html中有&lt;如果想把它换成 < 就可以使用下面的方法
    vremark = $('<span/>').html(vremark).text();

    //创建出编辑器
    var ueditor = UE.getEditor('editor',null,function(){
         ueditor.setContent(vremark);
    });

    /***
    投机取巧
    setTimeout(function(){
        ueditor.setContent("111122223333",true);
    },250);
    **/

    //正确的思路,在ueditor完全渲染完毕之后再设置值
    
    
</script>

{{/block}}